<div id="groupList">
    <% for group in @createdGroups %>
    <table class="group" cellspacing="0" width="100%" border="0">
        <tr>
            <td class="groupImage">
                <a href="/group/home/<%=group.id%>">
                <% if group.portrait!="" %>
                <img src="/uploads/groupPortrait/<%=group.portrait%>" alt="<%=group.name%>" border="0" />
                <% else %>
                <img src="/img/default_portrait.jpg" alt="<%=group.name %>" border="0"/>
                <% end %>
                </a>
            </td>
            <td valign="top">
                <div class="groupContent">
                    <div class="groupName">
                        <a href="/group/home/<%=group.id%>"><%=group.name%></a> 我创建的
                    </div>
                    <div class="groupInfo">
                        会员：<%=group.members.count+1 %> 人 我们关注：<%=group.interesting%>
                    </div>
                    <div class="groupIntro">
                        介绍：<%=group.intro%></div>
                </div>
            </td>
            <td class="groupActionColumn">
                <ul class="groupActionList">
                    <li><a href="/group/home/<%=group.id%>">进入玩玩</a></li>
                    <% if isHost and not isCreatorByGroup(group) %>
                    <li><a href="/group/leave/<%=session[:user].id%>?group_id=<%=group.id%>">立刻退出</a></li>
                    <% end %>
                </ul>
            </td>
        </tr>
    </table>
    <% end %>
    
    <% for group in @groups%>
    <% group=Group.find(group.group_id) %>
    <table class="group" cellspacing="0" width="100%" border="0">
        <tr>
            <td class="groupImage">
                <a href="#">
                    <img src="/uploads/groupPortrait/<%=group.portrait%>" alt="<%=group.name%>" border="0" />
                </a>
            </td>
            <td valign="top">
                <div class="groupContent">
                    <div class="groupName">
                        <a href="/group/home/<%=group.id%>"><%=group.name%></a>
                    </div>
                    <div class="groupInfo">
                        会员：<%=group.members.count+1 %>人 我们关注：<%=group.interesting%>
                    </div>
                    <div class="groupIntro">
                        介绍：<%=group.intro%></div>
                </div>
            </td>
            <td class="groupActionColumn">
                <ul class="groupActionList">
                    <li><a href="/group/home/<%=group.id%>">进入玩玩</a></li>
                    <% if isHost %>
                    <li><a href="/group/leave/<%=session[:user].id%>?group_id=<%=group.id%>">立刻退出</a></li>
                    <% end %>
                </ul>
            </td>
        </tr>
    </table>
    <% end %>
</div>
<div class="pager">
    <ul>
        <% for page in @group_pages %>
            <%=
            if page==@group_pages.current()
                "<li class='currentPage'>#{page.number}</li>"
            else
                "<li><a href = '?page=#{page.number}' >#{page.number}</a></li>"
            end
            %>
        <% end %>
    </ul>
</div>